﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.ActiveRecord;
using System.ComponentModel.DataAnnotations;
using ZDSoft.QLMS.Entity.QuestionLibrary;

namespace ZDSoft.QLMS.Entity
{
    [ActiveRecord]
    public class Question : EntityBase<Question>
    {
        //题目内容
        [Display(Name="题目")]
        [Property]
        public string Title { get; set; }

        //题目类型
        [BelongsTo("TypeID")]
        public Entity.Type Type { get; set; }

        //审核是否通过
        [Property]
        public bool IsActive { get; set; }

        [Property]
        public string AuditOpinion { get; set; }

        //难易程度
        [Property]
        public DefficultDegree Degree { get; set; }

        //该题目拥有的答案
        [HasMany(typeof(Answer), ColumnKey = "QuestionID", Inverse = true)]
        public IList<Answer> Answers { get; set; }

        //该题目属于的知识点
        [BelongsTo("KnowledgePointID")]
        public KnowledgePoint KnowledgePoint { get; set; }

        //该题目属于的课程
        [BelongsTo("CourseID")]
        public Course Course { get; set; }

        [HasAndBelongsToMany(typeof(TestPaperMinPart), Table = "Question_TestPaperMinPart", ColumnRef = "TestPaperMinPartID", ColumnKey = "QuestionID")]
        IList<TestPaperMinPart> TestPaperParts { get; set; }
    }
}
